<template>
	<view>
		<u-popup mode="bottom" :show="showTimeline" @close="closePopup" round="24" :closeOnClickOverlay="true">
			<view class="timeline">
				<text class='iconfont icon-guanbi popup-close' @click="showTimeline = false"></text>
				<view class="timeline-name">联系商家</view>
				<view class="data-num">{{ phoneNum }}</view>
				<button class="pop-btn app-bac-color" @click="doCall">呼叫</button>
			</view>
		</u-popup>
	</view>
	
</template>
<script>
	export default {
		name: 'callphone',
		props:{
			
		},
		data() {
			return {
				showTimeline: false,
				phoneNum: '',
			};
		},
		mounted(){
			
		},
		methods: {
			openCall(val){
				this.phoneNum = val
				this.showTimeline = true
			},
			closePopup(){
				this.showTimeline = false
			},
			copy: function(val) {
				let that = this;
				uni.setClipboardData({
					data: val
				});
			},
			doCall(){
				console.log(this.phoneNum)
				uni.makePhoneCall({
					phoneNumber: this.phoneNum
				});
			}
		}
	}
</script>

<style lang="scss">
	.timeline {
		position: relative;
		padding: 40rpx 0 40rpx 0;
		max-height: 70vh;
		overflow: scroll;
		
		.data-num {
			margin-top: 56rpx;
			text-align: center;
			font-size: 42rpx;
			font-weight: bold;
			letter-spacing: 4rpx;
			
			height: 56rpx;
			font-size: 56rpx;
			color: #292929;
			line-height: 60rpx;
			letter-spacing: 2px;
		}
		
		.popup-close {
			position: absolute;
			right: 30rpx;
			top: 60rpx;
			z-index: 2;
			transform: translateY(-50%);
			font-size: 35rpx;
			color: #8a8a8a;
			font-weight: normal;
		}
		
		.timeline-name {
			font-size: 28rpx;
			font-weight: bold;
			color: #333333;
			text-align: center;
		}
		
		.timeline-nav {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 0 24rpx;
			margin-top: 24rpx;
			width: 100%;
			height: 80rpx;
			background: #F5F5F5;
			font-size: 28rpx;
			font-weight: 400;
			color: #333333;
			
			image {
				width: 48rpx;
				height: 48rpx;
				border-radius: 8rpx;
			}
		}
		
		.list {
			margin-top: 38rpx;
			position: relative;
			padding-left: 44rpx;
			
			.item {
				position: relative;
				z-index: 14;
				display: flex;
				margin-top: 48rpx;
				
				&:first-child { 
					margin-top: 0; 
					
					.title,.time {
						color: #F55045;
					}
					
					.circle {
						background: #F55045;
					}
				}
				
				.circle {
					position: relative;
					z-index: 10;
					margin-right: 30px;
					margin-top: 12rpx;
					width: 18rpx;
					height: 18rpx;
					background: #B8B8B8;
					border-radius: 50%;
				}
				
				.title {
					flex: 1;
					margin-right: 30px;
					font-size: 28rpx;
					color: #666666;
					line-height: 40rpx;
				}
				
				.time {
					margin-top: 16rpx;
					font-size: 24rpx;
					color: #B8B8B8;
				}
			}
			
			.line {
				position: absolute;
				top: 16rpx;
				left: 52rpx;
				z-index: 10;
				width: 2rpx;
				height: calc(100% - 80rpx);
				background-color: #F5F5F5;
			}
		}
		
		.pop-btn {
			margin: 60rpx auto 0 auto;
			width: 376rpx;
			height: 80rpx;
			background: #39CCC2;
			border-radius: 16rpx;
			height: 80rpx;
			line-height: 80rpx;
			text-align: center;
			font-size: 32rpx;
			font-weight: 500;
			color: #FFFFFF;
		}
	}
</style>